/*
 * BottomPaneel.java
 *
 * Created on 29 februari 2008, 18:56
 */

package be.hogent.iii.project.gui;

import be.hogent.iii.project.objects.Spel;

/**
 *
 * @author  Caribou
 */
public class BottomPaneel extends javax.swing.JPanel {
    
    private static final long serialVersionUID = 1L;
    
    private Spel spel;
    private PaneelEventHandler handler;
    
    /** Creates new form BottomPaneel */
    public BottomPaneel() {
        initComponents();
    }
    /**
     * 
     * @return
     */
    public Spel getSpel(){
        return spel;
    }
    /**
     * 
     * @param spel
     */
    public void setSpel(Spel spel){
        this.spel = spel;
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        console = new javax.swing.JTextArea();
        jButton1 = new javax.swing.JButton();

        setBackground(new java.awt.Color(0, 0, 0));

        console.setBackground(new java.awt.Color(102, 51, 0));
        console.setColumns(20);
        console.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        console.setForeground(new java.awt.Color(204, 153, 0));
        console.setRows(5);
        jScrollPane1.setViewportView(console);

        jButton1.setBackground(new java.awt.Color(102, 51, 0));
        jButton1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButton1.setForeground(new java.awt.Color(204, 153, 0));
        jButton1.setText("Einde beurt");
        jButton1.setName("eindeBeurt"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 353, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        spel.eindeBeurt();
        handler.beginBeurt();
    }//GEN-LAST:event_jButton1ActionPerformed
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea console;
    private javax.swing.JButton jButton1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables

    public javax.swing.JTextArea getConsole() {
        return console;
    }

    public PaneelEventHandler getHandler() {
        return handler;
    }

    public void setHandler(PaneelEventHandler handler) {
        this.handler = handler;
    }
    
}
